//
//  WXAlipayModule.swift
//  mlz
//
//  Created by 吕凌 on 2018/5/24.
//  Copyright © 2018年 吕凌. All rights reserved.
//

import Foundation

public extension WXAlipayModule {
    
    @objc public func pay(_ params:[String:Any], callback: @escaping WXModuleKeepAliveCallback) {
        let orderInfo: String = params["orderInfo"]! as! String
        StaticContext.alipayCallback = callback
        AlipaySDK.defaultService().payOrder(orderInfo, fromScheme: "com.mlz.app", callback: { (resp) in
            callback(resp, false)
            StaticContext.alipayCallback = nil
        } )
    }
}
